package com.sywl.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sywl.dao.AssetDao;
import com.sywl.orm.Asset;
import com.sywl.service.AssetService;
import com.sywl.util.DataGridModel;

@Service(value="assetService")
@Transactional
public class AssetServiceImpl implements AssetService {

	@Resource(name="assetDao")
	private AssetDao assetDao;
	

	@Transactional
	public Map<String, Object> getPageList(DataGridModel dgm, Asset asset)
			throws Exception {
		return assetDao.getPageList(dgm, asset);
	}
	
	public void save(Asset entity) {
		assetDao.save(entity);
	}

	public void update(Asset entity) {
		assetDao.update(entity);
	}

	public void delete(Serializable id) {
		assetDao.delete(id);
	}

	public Asset findById(Serializable id) {
		return assetDao.findById(id);
	}

	public List<Asset> getAll() {
		return assetDao.getAll();
	}

	public List<Asset> findByHQL(String hql, Object... params) {
		return assetDao.findByHQL(hql, params);
	}
}
